<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>demo</title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <style type="text/css">
    body {
            height: 100%;
    }
    .index img{
      position:absolute;
      left:0px;
      top:0px;
      z-index:-1;
      width:100%!important;
      height:100%!important;
      width:expression(this.width > 150 ? "150px" : this.width)!important;
    }
    </style>
</head>

<body>
<div class = "index">
        <img  src="image/start.png" alt="">
</div>
<div hidden><p id="sp"></p></div>
</body>
<script type="text/javascript" src="./script/api.js"></script>

<script language=javascript>
onload=function(){
    setInterval(go, 1000);
};
var x=3; //利用了全局变量来执行
function go(){
    if(x>0){
        document.getElementById("sp").innerHTML=x; //每次设置的x的值都不一样了。
        x--;
    }else{
        location.href='html/start.html';
    }
}
</script>
<script type="text/javascript">
apiready = function() {
        // api.openFrame({
        //         name: 'start',
        //         url: 'html/start.html',
        //         bounces: true,
        //         rect: {
        //                 // 推荐使用Margin布局，用于适配屏幕的动态变化
        //                 w: 'auto', // main页面的宽度 自适应屏幕宽度
        //                 h:  'auto'
        //         }
        // });
        api.setScreenOrientation({
                orientation: 'landscape_left'
        });
};
</script>

</html>
